home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Drag.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  8.2 KB  |  470 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Drag.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  18. __DRAG__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  22.     include 'AppleEvents.a'
  23.     ENDIF
  24. ;        include 'Errors.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'Types.a'                                            ;
  27. ;        include 'Memory.a'                                            ;
  28. ;            include 'MixedMode.a'                                    ;
  29. ;        include 'OSUtils.a'                                        ;
  30. ;        include 'Events.a'                                            ;
  31. ;            include 'Quickdraw.a'                                    ;
  32. ;                include 'QuickdrawText.a'                            ;
  33. ;        include 'EPPC.a'                                            ;
  34. ;            include 'PPCToolbox.a'                                    ;
  35. ;                include 'AppleTalk.a'                                ;
  36. ;            include 'Processes.a'                                    ;
  37. ;                include 'Files.a'                                    ;
  38. ;        include 'Notification.a'                                    ;
  39.  
  40.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  41.     include 'TextEdit.a'
  42.     ENDIF
  43.  
  44. ; Flavor Flags 
  45. flavorSenderOnly                EQU        $00000001            ; flavor is available to sender only 
  46. flavorSenderTranslated            EQU        $00000002            ; flavor is translated by sender 
  47. flavorNotSaved                    EQU        $00000004            ; flavor should not be saved 
  48. flavorSystemTranslated            EQU        $00000100            ; flavor is translated by system 
  49.  
  50. ; Drag Attributes 
  51. dragHasLeftSenderWindow            EQU        $00000001            ; drag has left the source window since TrackDrag 
  52. dragInsideSenderApplication        EQU        $00000002            ; drag is occurring within the sender application 
  53. dragInsideSenderWindow            EQU        $00000004            ; drag is occurring within the sender window 
  54.  
  55. ; Special Flavor Types 
  56. flavorTypeHFS                    EQU        'hfs '                ; flavor type for HFS data 
  57. flavorTypePromiseHFS            EQU        'phfs'                ; flavor type for promised HFS data 
  58. flavorTypeDirectory                EQU        'diry'
  59.  
  60. ; Drag Tracking Handler Messages 
  61. dragTrackingEnterHandler        EQU        1                    ; drag has entered handler 
  62. dragTrackingEnterWindow            EQU        2                    ; drag has entered window 
  63. dragTrackingInWindow            EQU        3                    ; drag is moving within window 
  64. dragTrackingLeaveWindow            EQU        4                    ; drag has exited window 
  65. dragTrackingLeaveHandler        EQU        5                    ; drag has exited handler 
  66.  
  67. ; Drag Drawing Procedure Messages 
  68. dragRegionBegin                    EQU        1                    ; initialize drawing 
  69. dragRegionDraw                    EQU        2                    ; draw drag feedback 
  70. dragRegionHide                    EQU        3                    ; hide drag feedback 
  71. dragRegionIdle                    EQU        4                    ; drag feedback idle time 
  72. dragRegionEnd                    EQU        5                    ; end of drawing 
  73.  
  74. ; Zoom Acceleration 
  75. zoomNoAcceleration                EQU        0                    ; use linear interpolation 
  76. zoomAccelerate                    EQU        1                    ; ramp up step size 
  77. zoomDecelerate                    EQU        2                    ; ramp down step size 
  78.  
  79. ; Drag Manager Data Types 
  80. ; HFS Flavors 
  81. HFSFlavor                 RECORD    0
  82. fileType                 ds.l    1                                    ; file type 
  83. fileCreator                 ds.l    1                                    ; file creator 
  84. fdFlags                     ds.w    1                                    ; Finder flags 
  85. fileSpec                 ds        FSSpec                                ; file system specification 
  86. sizeof                     EQU    80
  87.                         ENDR
  88.  
  89. PromiseHFSFlavor         RECORD    0
  90. fileType                 ds.l    1                                    ; file type 
  91. fileCreator                 ds.l    1                                    ; file creator 
  92. fdFlags                     ds.w    1                                    ; Finder flags 
  93. promisedFlavor             ds.l    1                                    ; promised flavor containing an FSSpec 
  94. sizeof                     EQU    14
  95.                         ENDR
  96.  
  97. ; Application-Defined Drag Handler Routines 
  98. ; Application-Defined Routines 
  99. ; Drag Manager Routines 
  100. ; Installing and Removing Drag Handlers 
  101.     IF GENERATING68K THEN
  102.         Macro
  103.         _InstallTrackingHandler
  104.             moveq    #1,d0
  105.             dc.w     $ABED
  106.         EndM
  107.     ELSE
  108.         IMPORT    InstallTrackingHandler
  109.     ENDIF
  110.  
  111.     IF GENERATING68K THEN
  112.         Macro
  113.         _InstallReceiveHandler
  114.             moveq    #2,d0
  115.             dc.w     $ABED
  116.         EndM
  117.     ELSE
  118.         IMPORT    InstallReceiveHandler
  119.     ENDIF
  120.  
  121.     IF GENERATING68K THEN
  122.         Macro
  123.         _RemoveTrackingHandler
  124.             moveq    #3,d0
  125.             dc.w     $ABED
  126.         EndM
  127.     ELSE
  128.         IMPORT    RemoveTrackingHandler
  129.     ENDIF
  130.  
  131.     IF GENERATING68K THEN
  132.         Macro
  133.         _RemoveReceiveHandler
  134.             moveq    #4,d0
  135.             dc.w     $ABED
  136.         EndM
  137.     ELSE
  138.         IMPORT    RemoveReceiveHandler
  139.     ENDIF
  140.  
  141. ; Creating and Disposing Drag References 
  142.     IF GENERATING68K THEN
  143.         Macro
  144.         _NewDrag
  145.             moveq    #5,d0
  146.             dc.w     $ABED
  147.         EndM
  148.     ELSE
  149.         IMPORT    NewDrag
  150.     ENDIF
  151.  
  152.     IF GENERATING68K THEN
  153.         Macro
  154.         _DisposeDrag
  155.             moveq    #6,d0
  156.             dc.w     $ABED
  157.         EndM
  158.     ELSE
  159.         IMPORT    DisposeDrag
  160.     ENDIF
  161.  
  162. ; Adding Drag Item Flavors 
  163.     IF GENERATING68K THEN
  164.         Macro
  165.         _AddDragItemFlavor
  166.             moveq    #7,d0
  167.             dc.w     $ABED
  168.         EndM
  169.     ELSE
  170.         IMPORT    AddDragItemFlavor
  171.     ENDIF
  172.  
  173.     IF GENERATING68K THEN
  174.         Macro
  175.         _SetDragItemFlavorData
  176.             moveq    #9,d0
  177.             dc.w     $ABED
  178.         EndM
  179.     ELSE
  180.         IMPORT    SetDragItemFlavorData
  181.     ENDIF
  182.  
  183. ; Providing Drag Callback Procedures 
  184.     IF GENERATING68K THEN
  185.         Macro
  186.         _SetDragSendProc
  187.             moveq    #10,d0
  188.             dc.w     $ABED
  189.         EndM
  190.     ELSE
  191.         IMPORT    SetDragSendProc
  192.     ENDIF
  193.  
  194.     IF GENERATING68K THEN
  195.         Macro
  196.         _SetDragInputProc
  197.             moveq    #11,d0
  198.             dc.w     $ABED
  199.         EndM
  200.     ELSE
  201.         IMPORT    SetDragInputProc
  202.     ENDIF
  203.  
  204.     IF GENERATING68K THEN
  205.         Macro
  206.         _SetDragDrawingProc
  207.             moveq    #12,d0
  208.             dc.w     $ABED
  209.         EndM
  210.     ELSE
  211.         IMPORT    SetDragDrawingProc
  212.     ENDIF
  213.  
  214. ; Performing a Drag 
  215.     IF GENERATING68K THEN
  216.         Macro
  217.         _TrackDrag
  218.             moveq    #13,d0
  219.             dc.w     $ABED
  220.         EndM
  221.     ELSE
  222.         IMPORT    TrackDrag
  223.     ENDIF
  224.  
  225. ; Getting Drag Item Information 
  226.     IF GENERATING68K THEN
  227.         Macro
  228.         _CountDragItems
  229.             moveq    #14,d0
  230.             dc.w     $ABED
  231.         EndM
  232.     ELSE
  233.         IMPORT    CountDragItems
  234.     ENDIF
  235.  
  236.     IF GENERATING68K THEN
  237.         Macro
  238.         _GetDragItemReferenceNumber
  239.             moveq    #15,d0
  240.             dc.w     $ABED
  241.         EndM
  242.     ELSE
  243.         IMPORT    GetDragItemReferenceNumber
  244.     ENDIF
  245.  
  246.     IF GENERATING68K THEN
  247.         Macro
  248.         _CountDragItemFlavors
  249.             moveq    #16,d0
  250.             dc.w     $ABED
  251.         EndM
  252.     ELSE
  253.         IMPORT    CountDragItemFlavors
  254.     ENDIF
  255.  
  256.     IF GENERATING68K THEN
  257.         Macro
  258.         _GetFlavorType
  259.             moveq    #17,d0
  260.             dc.w     $ABED
  261.         EndM
  262.     ELSE
  263.         IMPORT    GetFlavorType
  264.     ENDIF
  265.  
  266.     IF GENERATING68K THEN
  267.         Macro
  268.         _GetFlavorFlags
  269.             moveq    #18,d0
  270.             dc.w     $ABED
  271.         EndM
  272.     ELSE
  273.         IMPORT    GetFlavorFlags
  274.     ENDIF
  275.  
  276.     IF GENERATING68K THEN
  277.         Macro
  278.         _GetFlavorDataSize
  279.             moveq    #19,d0
  280.             dc.w     $ABED
  281.         EndM
  282.     ELSE
  283.         IMPORT    GetFlavorDataSize
  284.     ENDIF
  285.  
  286.     IF GENERATING68K THEN
  287.         Macro
  288.         _GetFlavorData
  289.             moveq    #20,d0
  290.             dc.w     $ABED
  291.         EndM
  292.     ELSE
  293.         IMPORT    GetFlavorData
  294.     ENDIF
  295.  
  296.     IF GENERATING68K THEN
  297.         Macro
  298.         _GetDragItemBounds
  299.             moveq    #21,d0
  300.             dc.w     $ABED
  301.         EndM
  302.     ELSE
  303.         IMPORT    GetDragItemBounds
  304.     ENDIF
  305.  
  306.     IF GENERATING68K THEN
  307.         Macro
  308.         _SetDragItemBounds
  309.             moveq    #22,d0
  310.             dc.w     $ABED
  311.         EndM
  312.     ELSE
  313.         IMPORT    SetDragItemBounds
  314.     ENDIF
  315.  
  316.     IF GENERATING68K THEN
  317.         Macro
  318.         _GetDropLocation
  319.             moveq    #23,d0
  320.             dc.w     $ABED
  321.         EndM
  322.     ELSE
  323.         IMPORT    GetDropLocation
  324.     ENDIF
  325.  
  326.     IF GENERATING68K THEN
  327.         Macro
  328.         _SetDropLocation
  329.             moveq    #24,d0
  330.             dc.w     $ABED
  331.         EndM
  332.     ELSE
  333.         IMPORT    SetDropLocation
  334.     ENDIF
  335.  
  336. ; Getting Information About a Drag 
  337.     IF GENERATING68K THEN
  338.         Macro
  339.         _GetDragAttributes
  340.             moveq    #25,d0
  341.             dc.w     $ABED
  342.         EndM
  343.     ELSE
  344.         IMPORT    GetDragAttributes
  345.     ENDIF
  346.  
  347.     IF GENERATING68K THEN
  348.         Macro
  349.         _GetDragMouse
  350.             moveq    #26,d0
  351.             dc.w     $ABED
  352.         EndM
  353.     ELSE
  354.         IMPORT    GetDragMouse
  355.     ENDIF
  356.  
  357.     IF GENERATING68K THEN
  358.         Macro
  359.         _SetDragMouse
  360.             moveq    #27,d0
  361.             dc.w     $ABED
  362.         EndM
  363.     ELSE
  364.         IMPORT    SetDragMouse
  365.     ENDIF
  366.  
  367.     IF GENERATING68K THEN
  368.         Macro
  369.         _GetDragOrigin
  370.             moveq    #28,d0
  371.             dc.w     $ABED
  372.         EndM
  373.     ELSE
  374.         IMPORT    GetDragOrigin
  375.     ENDIF
  376.  
  377.     IF GENERATING68K THEN
  378.         Macro
  379.         _GetDragModifiers
  380.             moveq    #29,d0
  381.             dc.w     $ABED
  382.         EndM
  383.     ELSE
  384.         IMPORT    GetDragModifiers
  385.     ENDIF
  386.  
  387. ; Drag Highlighting 
  388.     IF GENERATING68K THEN
  389.         Macro
  390.         _ShowDragHilite
  391.             moveq    #30,d0
  392.             dc.w     $ABED
  393.         EndM
  394.     ELSE
  395.         IMPORT    ShowDragHilite
  396.     ENDIF
  397.  
  398.     IF GENERATING68K THEN
  399.         Macro
  400.         _HideDragHilite
  401.             moveq    #31,d0
  402.             dc.w     $ABED
  403.         EndM
  404.     ELSE
  405.         IMPORT    HideDragHilite
  406.     ENDIF
  407.  
  408.     IF GENERATING68K THEN
  409.         Macro
  410.         _DragPreScroll
  411.             moveq    #32,d0
  412.             dc.w     $ABED
  413.         EndM
  414.     ELSE
  415.         IMPORT    DragPreScroll
  416.     ENDIF
  417.  
  418.     IF GENERATING68K THEN
  419.         Macro
  420.         _DragPostScroll
  421.             moveq    #33,d0
  422.             dc.w     $ABED
  423.         EndM
  424.     ELSE
  425.         IMPORT    DragPostScroll
  426.     ENDIF
  427.  
  428.     IF GENERATING68K THEN
  429.         Macro
  430.         _UpdateDragHilite
  431.             moveq    #34,d0
  432.             dc.w     $ABED
  433.         EndM
  434.     ELSE
  435.         IMPORT    UpdateDragHilite
  436.     ENDIF
  437.  
  438. ; Drag Manager Utilities 
  439.     IF GENERATING68K THEN
  440.         Macro
  441.         _WaitMouseMoved
  442.             moveq    #35,d0
  443.             dc.w     $ABED
  444.         EndM
  445.     ELSE
  446.         IMPORT    WaitMouseMoved
  447.     ENDIF
  448.  
  449.     IF GENERATING68K THEN
  450.         Macro
  451.         _ZoomRects
  452.             moveq    #36,d0
  453.             dc.w     $ABED
  454.         EndM
  455.     ELSE
  456.         IMPORT    ZoomRects
  457.     ENDIF
  458.  
  459.     IF GENERATING68K THEN
  460.         Macro
  461.         _ZoomRegion
  462.             moveq    #37,d0
  463.             dc.w     $ABED
  464.         EndM
  465.     ELSE
  466.         IMPORT    ZoomRegion
  467.     ENDIF
  468.  
  469.     ENDIF ; __DRAG__
  470.